<?xml version="1.0" encoding="utf-8"?><!-- DWXMLSource="http://localhost/myfav/?type=movetocat" --><!DOCTYPE xsl:stylesheet  [
	<!ENTITY nbsp   "&#160;">
	<!ENTITY copy   "&#169;">
	<!ENTITY reg    "&#174;">
	<!ENTITY trade  "&#8482;">
	<!ENTITY mdash  "&#8212;">
	<!ENTITY ldquo  "&#8220;">
	<!ENTITY rdquo  "&#8221;"> 
	<!ENTITY pound  "&#163;">
	<!ENTITY yen    "&#165;">
	<!ENTITY euro   "&#8364;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="/">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>移动到分类</title>
<base target="_self" />
<style type="text/css">
html,body { margin:0; padding:0}
body { font-size:12px;}
select { font-size:12px; font-family:Verdana, Arial, Helvetica, sans-serif}
.box { padding:2em 1em}
.dropdown { text-align:left; padding:1.4em 1em}
.dropdown select { width:98%}
.btn { margin:0 1.3em; text-align:right; }
.btn button {width:50px; height:26px;}
form { margin:0; padding:0}
strong { margin:0 2px}
</style>
</head>

<body>
<div class="box">
<form name="form1" method="post" action="?type=movetocataction" onsubmit="return this.category.value==-1 ? false : true">
共选择了<strong><xsl:value-of select="count(/root/movecat/fav)" /></strong>条记录，把这些记录移动到指定分类：
<div class="dropdown">
<select name="category">
<option value="-1">--请选择--</option>
<option value="0">未分类</option>
<xsl:call-template name="getOptions">
<xsl:with-param name="pid" select="0" />
<xsl:with-param name="str" select="string('├')" />
</xsl:call-template>
</select>
</div>
<div class="btn"><button type="submit">确定</button></div>
<xsl:for-each select="/root/movecat/fav">
<input type="hidden" name="fid" value="{.}" />
</xsl:for-each>
</form>
</div>
</body>

</html>

</xsl:template>

<xsl:template name="getOptions">
<xsl:param name="pid" />
<xsl:param name="str" />
<xsl:for-each select="/root/category/cat[@pid=$pid]">
<xsl:variable name="cid" select="@id" />
<option value="{@id}" title="{.}"><xsl:value-of select="$str" /> <xsl:value-of select="." /></option>
<xsl:if test="/root/category/cat[@pid=$cid]">
	<xsl:call-template name="getOptions">
    <xsl:with-param name="pid" select="$cid" />
    <xsl:with-param name="str" select="concat('　',$str)" />
    </xsl:call-template>
</xsl:if>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>